//
//  LoadingView.swift
//  PhotoTestDemo
//
//  Created by 惠 on 2020/9/17.
//  Copyright © 2020 惠. All rights reserved.
//

import UIKit

class LoadingView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        isHidden = true
        backgroundColor = .white
        layer.cornerRadius = 6
        layer.masksToBounds = true
        
        addSubview(activeLabel)
        addSubview(activeView)
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var activeView: UIActivityIndicatorView = {
        let activeView = UIActivityIndicatorView(style: .whiteLarge)
        activeView.frame = CGRect(origin: CGPoint(x: 15, y: 10), size: CGSize(width: 50, height: 50))
        activeView.color = UIColor(red: 0.25, green: 0.76, blue: 0.8, alpha: 1)
        activeView.layer.cornerRadius = 50
        return activeView
    }()
    
    lazy var activeLabel: UILabel = {
        let activeLabel = UILabel(frame: CGRect(origin: CGPoint(x: 0, y: 60), size: CGSize(width: 80, height: 20)))
        activeLabel.text = "视频处理中…"
        activeLabel.textAlignment = .center
        activeLabel.font = UIFont.systemFont(ofSize: 12)
        activeLabel.textColor = .black
        return activeLabel
    }()
}
